package com.cisc.business.order.service;

import com.cisc.business.user.dto.UserInfo;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.List;

/**
 * @description: 用户服务
 * @author: daizh
 * @time: 2021/6/20 15:05
 */
@FeignClient(name = "user-service")
public interface UserService {

    @GetMapping("/user/userId/{userId}")
    public UserInfo getUserById(@PathVariable("userId") Integer userId);

    @GetMapping("/user/userName/{username}")
    public List<UserInfo> getUserByName(@PathVariable("username")String username);

    @GetMapping("/user/allUsers")
    public List<UserInfo> getAllUsers();

    @PostMapping("/usersave")
    public String saveUserInfo(@RequestBody UserInfo userInfo);
}
